module.exports = {
  presets: [
    [
      "@babel/preset-env",
      {
        useBuiltIns: "usage",
        corejs: "3",
      },
    ],
    // 注意不能用，这只适用于 vue2
    // https://blog.csdn.net/rolinabc/article/details/122845471
    // ["@vue/babel-preset-jsx"],
    [
      "@babel/preset-typescript",
      {
        allExtensions: true, // 支持所有文件扩展名，否则在vue文件中使用ts会报错
        //否则报错 SyntaxError: Wrap.vue: Unexpected token, expected "," (26:12)
      },
    ],
  ],
  plugins: [
    // vue3 支持 jsx
    "@vue/babel-plugin-jsx",
    [
      "@babel/plugin-transform-runtime",
      {
        corejs: 3,
      },
    ],
  ],
};
